var table;
var layer;
layui.use(['layer','table'],function(){
    table=layui.table;
    layer=layui.layer;
    selCourseRecord()
});

//获取课程审核详情数据
function selCourseRecord() {

    //从父页面获取课程id
    var course_id=parent.$("#course_id").val();
    $.ajax({
        url: "/SyOperationController/selCourseRecord",
        type: "post",
        dataType:"json",
        data:{"type":2,"course_id":course_id},    //课程type是2，把课程id传入
        success: function (data) {
            getTable(data.data);
        }
    });
}

//获取课程审核详情数据赋值给table
function getTable(data){
    var tb1=table.render({
        elem:"#table_id",
        title:"审核详情",
        limit:5,
        data:data,
        page:true,
        cols:[[
            {field:'cId',title:'id',align:'center',hide:true},
            {field:'implement_date',title:'审核时间',width:200,align:'center',templet:function(d){
                    var date=d.implement_date;
                    date = date.slice(0, date.indexOf("."));
                    date = date.replaceAll('T',' ');
                    return date;
                }},
            {field:'true_name',title:'审核人员',width:150,align:'center'},
            {field:'result',title:'审核结果',width:120,align:'center'},
            {field:'details',title:'反馈详情',align:'center'}
        ]]
    });

}